#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

bool bits[10086] = { false };
vector<int> nums;

bool fun(int n)
{
    bool rl, rr;
    int left, right;
    left = n / 2;
    right = n - left;
    
    while (true)
    {
        while (left > 1 && (bits[left] || bits[right]))
        {
            left--;
            right++;
        }
        if (left == 1)
        {
            return false;
        }
        cout << left << " " << right << "\n";
        rl = fun(left);
        rr = fun(right);
        if (rl && rr)
        {
            bits[left] = true;
            bits[right] = true;
            nums.push_back(left);
        }
        
    }
    

}

int main(int argc, char const *argv[])
{
    int n;
    cin >> n;
    fun(n);
    for (size_t i = 0; i < nums.size(); i++)
    {
        cout << nums[i] << " ";
    }
    
    return 0;
}
